home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / B-C / C++ FAQ Reference 1.0 / C++ FAQ Reference 1.0.rsrc / TEXT_228.txt < prev    next >
Encoding:
Text File  |  1993-06-30  |  588 b   |  1 lines

  1. A class defines a data type, much like a struct would be in C.  In a CompSci sense, a type consists of two things: a set of values *and* a set of operations which operate on those values.  Thus 'int' all by itself isn't a true 'type' until you add operations like 'add two ints' or 'int*int', etc.  In exactly the same way, a 'class' provides a set of (usually 'public') operations, and a set of (usually non-public) data bits representing the abstract values that instances of the type can have.  From a C language perspective, a 'class' is a 'struct' whose members default to 'private'.